package darknet.application.filesharing.spec;

import darknet.application.Application;
import java.io.File;

/**
 * Interface for a P2P file-sharing application.
 *
 * @author yoyo
 */
public interface FileSharingApplication extends Application {

    /**
     * Make a release via a file or a directory.
     * 
     * @param fileOrDirectory File or directory in the node filesystem.
     * @return The release created.
     */
    Release makeRelease(File fileOrDirectory);

    /**
     * Share a release.
     * 
     * @param toShare
     */
    void shareRelease(Release toShare);

    /**
     * Unshare a release
     *
     * @param toUnshare
     */
    void unshareRelease(Release toUnshare);

    /**
     * @return All shared releases.
     */
    Release[] getSharedReleases();

    /**
     * @return Informations about a shared release, like pourcent complete, etc.
     */
    SharedReleaseInformation getSharedReleaseInfo();
}
